//
//  WBUIView+extension.swift
//  SinaWeibo
//
//  Created by 风不会停息 on 2016/11/30.
//  Copyright © 2016年 风不会停息. All rights reserved.
//

import Foundation

extension UIView{
    
    func findNavController() -> UINavigationController? {
        
        //获取当前控件的下一响应者
        var response = self.next
        
        while response != nil {
            if let obj = response as? UINavigationController {
                return obj
            }
            response = response?.next
        }
        
        
        
        return UINavigationController()
    }
    
    
}
